starwars |>
count(homeworld)A few words about drop_na()
Summarizing Frequencies
Finding Unique Groups
distinct() – selects the unique / distinct rows from a dataset
Arguments
... – variables to use when determining uniqueness
.keep_all – decides if all of the columns should be kept
FALSE is default!Discritizing Variables
if_else()
case_when()
What if I want to perform the same operation across multiple columns?
across()
makes it easy to apply the same transformation to multiple columns, allowing you to use
select()semantics inside in “data-masking” functions likesummarise()andmutate()
across(.cols = everything(), .fns = NULL, ...)
Summarizing Multiple Columns
Conditional Summarizing
# A tibble: 1 × 3
height mass birth_year
<dbl> <dbl> <dbl>
1 174. 97.3 87.6
|>